# Contributor: Jakob Meier <comcloudway@ccw.icu>
# Maintainer: Jakob Meier <comcloudway@ccw.icu>
pkgname=rnote
pkgver=0.9.4
pkgrel=0
pkgdesc="Sketch and take handwritten notes."
url="https://rnote.flxzt.net/"
# ppc64le: vendored abseil, not possible to override to system
# armhf: doesn't build
# s390x: mainframe
arch="all !armhf !s390x !ppc64le"
license="GPL-3.0-or-later"
makedepends="
	alsa-lib-dev
	appstream-glib-dev
	appstream-dev
	cargo
	clang-dev
	cmake
	desktop-file-utils
	gtk4.0-dev
	libadwaita-dev
	meson
	poppler-dev
	"
subpackages="$pkgname-lang $pkgname-cli:cli"
source="
	https://github.com/flxzt/rnote/archive/refs/tags/v$pkgver/rnote-$pkgver.tar.gz
"
options="net"

export CARGO_PROFILE_RELEASE_LTO=thin

build() {
	abuild-meson \
		. output

	meson configure -Dcli=true output
	meson compile -C output
}
check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

cli() {
	pkgdesc="Convert files to and from .rnote"

	amove usr/bin/rnote-cli
}

sha512sums="
a0afbcdd7ff794a6ed31ab9bc8a453f2dfb967b6ca86e6b6673762b5fee6995997287c2259f486bbee083ee54b7dfe4586bf4a1d6cd7d9fc82d2544e107a69b2  rnote-0.9.4.tar.gz
"
